{namespace form=TYPO3\CMS\Form\ViewHelpers}

<f:if condition="{model.showElement}">
	<li class="csc-form-{model.elementCounter} csc-form-element csc-form-element-{model.elementTypeLowerCase}">
		<label for="{model.additionalArguments.id}">
			{model.additionalArguments.label}
			<f:if condition="{model.mandatoryValidationMessages}">
				<em><f:for each="{model.mandatoryValidationMessages}" as="mandatoryValidationMessage" iteration="iterator">{mandatoryValidationMessage}<f:if condition="{iterator.isLast}"><f:else> - </f:else></f:if></f:for></em>
			</f:if>
			<f:if condition="{model.validationErrorMessages}">
				<strong><f:for each="{model.validationErrorMessages}" as="errorValidationMessage" iteration="iterator">{errorValidationMessage}<f:if condition="{iterator.isLast}"><f:else> - </f:else></f:if></f:for></strong>
			</f:if>
		</label>

		<form:select
			class="{model.additionalArguments.class}"
			dir="{model.additionalArguments.dir}"
			id="{model.additionalArguments.id}"
			lang="{model.additionalArguments.lang}"
			style="{model.additionalArguments.style}"
			title="{model.additionalArguments.title}"
			accesskey="{model.additionalArguments.accesskey}"
			tabindex="{model.additionalArguments.tabindex}"
			onclick="{model.additionalArguments.onclick}"

			name="{model.additionalArguments.prefix}[{model.additionalArguments.name}]"
			value="{form:aggregateSelectOptions(model:model, returnSelectedValues: 1)}"

			multiple="{model.additionalArguments.multiple}"
			size="{model.additionalArguments.size}"

			optionLabelField="label"
			optionValueField="value"
			options="{form:aggregateSelectOptions(model:model)}"
			prependOptionLabel="{model.additionalArguments.prependOptionLabel}"
			prependOptionValue="{model.additionalArguments.prependOptionValue}"
			selectAllByDefault="{model.additionalArguments.selectAllByDefault}"
			sortByOptionLabel="{model.additionalArguments.sortByOptionLabel}"

			errorClass="{model.additionalArguments.errorClass}"
			additionalAttributes="{model.htmlAttributes}"
		/>
	</li>
</f:if>
